﻿create VIEW [dbo].[Sys_TablePrimaryKeys]
AS
SELECT     TOP 100 PERCENT a.Table_Name, a.Column_Name
FROM         INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE a INNER JOIN
                      INFORMATION_SCHEMA.TABLE_CONSTRAINTS b ON a.constraint_name = b.constraint_name
WHERE     (b.constraint_type = 'PRIMARY KEY')
ORDER BY a.table_name, a.column_name


